#include <stdio.h>
#include <stdlib.h>

typedef struct Student Student;
struct Student {
  int id;
  char name[20];
  char gender;
};

int main(int argc, char *argv[]) {
  /* 指向结构体数组的指针
   */
  Student s[] = {{1001, "Tom", 'M'}, {1002, "Jerry", 'M'}, {1003, "Lily", 'F'}};
  // Student *p = s;
  /* for (int i = 0; i < 3; i++) {
    printf("id = %d\tname = %s\tgender = %c\n", (p + i)->id, (p + i)->name,
           (p + i)->gender);
  } */
  for (Student *p = s; p < s + 3; p++) {
    printf("id = %d\tname = %s\tgender = %c\n", p->id, p->name, p->gender);
  }
  return EXIT_SUCCESS;
}
